﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:myView="clr-namespace:Studio77.GuessTheWords2.Views"
    xmlns:UI="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"
    x:Class="Studio77.GuessTheWords2.Pages.GamePage"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <Style x:Key="ButtonStyleReturn" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image1">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image1" Source="/Images/btn_gameback.png" Stretch="Fill"/>
                            <Image x:Name="image" Source="/Images/btn_gameback_press.png" Stretch="Fill" Visibility="Collapsed"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleShop" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image1">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image1" Source="/Images/btn_shop.png" Stretch="Fill"/>
                            <Image x:Name="image" Source="/Images/btn_shop_press.png" Stretch="Fill" Visibility="Collapsed"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleLamp" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image1">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image" Source="/Images/btn_lamp.png" Stretch="Fill"/>
                            <Image x:Name="image1" Source="/Images/btn_lamp_press.png" Stretch="Fill" Visibility="Collapsed"/>
                            <ContentPresenter VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="30,0,0,0"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ButtonStyleRestart" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image1">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Disabled"/>
                                    <VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="image1" Source="/Images/btn_restart.png" Stretch="Fill"/>
                            <Image x:Name="image" Source="/Images/btn_restart_press.png" Stretch="Fill" Visibility="Collapsed"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </phone:PhoneApplicationPage.Resources>

    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush"/>
    </phone:PhoneApplicationPage.Foreground>

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Viewbox>
        <Grid x:Name="LayoutRoot" Background="Transparent" Height="800" Width="480">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="31*"/>
                <RowDefinition Height="688*"/>
                <RowDefinition Height="80"/>
            </Grid.RowDefinitions>
            <Image Source="/Images/gamebackground.png" Stretch="Fill" Grid.RowSpan="4" d:IsLocked="True"/>
            <Image Margin="8,0,74,305" Source="/Studio77.GuessTheWords2;component/Images/matrix_background.png" Stretch="Fill" Grid.RowSpan="3" d:IsLocked="True"/>
            <Grid Margin="8,1,-8,0" Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="10*"/>
                    <ColumnDefinition Width="103*"/>
                    <ColumnDefinition Width="76*"/>
                    <ColumnDefinition Width="34*"/>
                    <ColumnDefinition Width="61*"/>
                    <ColumnDefinition Width="26*"/>
                    <ColumnDefinition Width="170*"/>
                </Grid.ColumnDefinitions>
                <TextBlock x:Name="txtClassName" HorizontalAlignment="Center" TextWrapping="Wrap" Text="第1章" VerticalAlignment="Center" Foreground="White" Grid.Column="1" FontSize="21.333" FontWeight="Bold"/>
                <TextBlock x:Name="txtStageName" HorizontalAlignment="Center" TextWrapping="Wrap" Text="关卡-45" VerticalAlignment="Center" Foreground="White" Grid.Column="2" FontSize="18.667" FontWeight="Bold"/>
                <TextBlock x:Name="txtCompleteInfo" HorizontalAlignment="Left" TextWrapping="Wrap" Text="12/24" VerticalAlignment="Center" Foreground="White" Grid.Column="4" FontSize="18.667" Margin="0"/>
                <TextBlock x:Name="txtTime" HorizontalAlignment="Left" TextWrapping="Wrap" Text="2'45" VerticalAlignment="Center" Foreground="White" Grid.Column="6" FontSize="18.667" Margin="6,0,0,0"/>

            </Grid>
            <StackPanel HorizontalAlignment="Left" Height="354" Margin="407,10,0,0" Grid.Row="2" VerticalAlignment="Top" Width="67">
                <Button x:Name="btnReturn" Content="Button" HorizontalAlignment="Center" Height="72" Margin="0" Style="{StaticResource ButtonStyleReturn}" VerticalAlignment="Center" Width="53" Click="btnReturn_Click"/>
                <Button Content="Button" HorizontalAlignment="Center" Height="74" Margin="0,13,0,0" Style="{StaticResource ButtonStyleShop}" VerticalAlignment="Center" Width="64" Click="ShopButton_Click_1"/>
                <Button x:Name="btnLamp" Content="23" HorizontalAlignment="Center" Height="92" Margin="0,13,0,0" Style="{StaticResource ButtonStyleLamp}" VerticalAlignment="Center" Width="62" FontSize="18.667" Foreground="White" Click="btnLamp_Click"/>
                <Button x:Name="btnRestart" Content="Button" HorizontalAlignment="Center" Height="74" Margin="0,13,0,0" Style="{StaticResource ButtonStyleRestart}" VerticalAlignment="Center" Width="69" Click="btnRestart_Click"/>
            </StackPanel>
            <Image Margin="0,5,0,0" Source="/Studio77.GuessTheWords2;component/Images/bottombar.png" Stretch="Fill" Grid.Row="3" Width="480" Height="75" HorizontalAlignment="Left" VerticalAlignment="Top" d:IsLocked="True"/>
            <Image Margin="18,394,17,0" Source="/Studio77.GuessTheWords2;component/Images/tip_background.png" Stretch="Fill" Grid.Row="2" Width="445" Height="137" HorizontalAlignment="Center" VerticalAlignment="Top" d:IsLocked="True"/>
            <Grid x:Name="girdTip" HorizontalAlignment="Left" Height="137" Margin="60,394,0,0" Grid.Row="2" VerticalAlignment="Top" Width="395">
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <TextBlock x:Name="txtTipHorizon" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" Foreground="#FFA80329"/>
                <TextBlock x:Name="txtTipVertical" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" Foreground="#FF006E2E" Grid.Row="1"/>
            </Grid>
            <myView:VisualKeyBoard Grid.Row="2" Margin="0,542,0,0" Height="144" Width="480" VerticalAlignment="Top" HorizontalAlignment="Center"/>
            <Border BorderThickness="1" HorizontalAlignment="Left" Height="370" Margin="23,3,0,0" Grid.Row="2" VerticalAlignment="Top" Width="370">
                <Canvas x:Name="cvsBlocks" HorizontalAlignment="Center" Height="360" VerticalAlignment="Center" Width="360"/>
            </Border>
            <Image x:Name="imgBanner" Grid.Row="3" Source="/Images/banner1.jpg" Stretch="Fill" Width="480" Height="80" VerticalAlignment="Bottom" Tap="imgBanner_Tap"/>

            <UI:AdControl x:Name="adControlMicrosoft" ErrorOccurred="msAdControl_ErrorOccurred_1" 
                          ApplicationId="e2e8bba4-e608-4416-bb4d-9b3a1417734c" 
                          AdUnitId="123668" HorizontalAlignment="Left" Height="80" Grid.Row="3" VerticalAlignment="Top" Width="480"/>
            <Grid x:Name="gridMsnAd" Grid.Row="3" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,0,0,0"/>
        </Grid>

    </Viewbox>

</phone:PhoneApplicationPage>